<template>
  <div class="container">
    <!--头部-->
    <div class="headTitle">
      <div class="icons" @click="backTo">
        <span class="iconfont">&#xe799;</span>
      </div>
      <div class="titles">服务中心</div>
      <div class="introduction"></div>
    </div>
    <!--欢迎部分-->
    <div class="welcomeTo">
      <!--头像-->
      <div class="photos">
        <img id="imgbase" alt="头像">
      </div>
      <!--信息部分-->
      <div class="userInfo">
        <div class="hi">
          <span>Hi,</span>
          <span>{{userName}}</span>
        </div>
        <div class="hisub">
          <span>欢迎使用菜鸟服务中心</span>
        </div>
      </div>
    </div>
    <!--在线咨询-->
    <div class="consult" @click="toConsult">
      在线咨询
    </div>
  </div>
</template>

<script>
  export default {
    name: "talking",
    methods:{
      backTo(){
        this.$router.push('/userMine');
      },
      toConsult(){
        this.$router.push('/consult');
      }
    },
    data(){
      return{
        imgbase:'',
        userName:''
      }
    },
    mounted() {
      let _this=this;
      // 获取图片数据并将其插入img元素
      let imgbase=window.sessionStorage.getItem('imgbase');
      document.getElementById('imgbase').setAttribute('src',imgbase);
      // 获取用户名
      _this.userName=window.sessionStorage.getItem('uname');
    }
  }
</script>

<style lang="scss" scoped>
  /*引入图标*/
  @import url("../../../assets/userIconFont/iconfont.css");
  .container{
    .headTitle{
      background-color: white;
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 60px 20px 20px 20px;
      margin-bottom: 5px;
      .icons{
        span{
          font-size: 40px;
          color: #8590a6;
        }
      }
      .titles{
        font-size: 35px;
      }
      .introduction{
        font-size: 30px;
      }
    }
    .welcomeTo{
      display: flex;
      align-content: center;
      background-color: deepskyblue;
      padding: 30px;
      .photos{
        margin-right: 50px;
        #imgbase{
          width: 100px;
          border-radius: 50px;
        }
      }
      .userInfo{
        .hi{
          color: white;
          font-size: 30px;
          font-weight: bolder;
          margin-bottom: 20px;
        }
        .hisub{
          font-size: 20px;
          color: white;
        }
      }
    }
    .consult{
      margin: 50px;
      padding: 10px 50px;
      letter-spacing: 10px;
      text-align: center;
      font-size: 50px;
      border: 1px solid deepskyblue;
      border-radius: 20px;
      color: #00c6ff;
    }
  }
</style>